package com.zcl.algorithms.递归;

import java.io.File;

/**
 * @Description:
 * @author: zcl
 * @date: 2022/3/8  18:01
 */
public class FileRecursion {

    public static void main(String[] args) {
//        getAllFile(new File("c:\\windows"));




    }



    public static void getAllFile(File dir){
        File[] files = dir.listFiles();
        if (files != null){
            for (File file : files) {
                if (file.isDirectory()){
                    System.out.println("目录: "+ file);
                    getAllFile(file);
                } else {
                    System.out.println("目录: "+ file);
                }

            }

        }
    }




}
